package education.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import education.dao.FileInfoDao;
import education.exception.ServiceException;
import education.model.FileInfo;
import education.service.FileInfoManager;

@Component("fileInfoManager")
public class FileInfoMangerImpl implements FileInfoManager {
	private FileInfoDao fileInfoDao;

	public FileInfoDao getFileInfoDao() {
		return fileInfoDao;
	}

	@Resource
	public void setFileInfoDao(FileInfoDao fileInfoDao) {
		this.fileInfoDao = fileInfoDao;
	}

	public void delete(FileInfo fileInfo) throws ServiceException{
		this.fileInfoDao.delete(fileInfo);

	}

	public boolean delete(int id)throws ServiceException {
		return fileInfoDao.delete(id);
	}

	public int getCount() throws ServiceException{
		return fileInfoDao.getCount();
	}

	public FileInfo loadById(int id) throws ServiceException {

		return fileInfoDao.loadById(id);
	}

	public List<FileInfo> paging(int pageSize, int pageCount, int rowCount) throws ServiceException{
		return this.fileInfoDao.paging(pageSize, pageCount, rowCount);
	}

	public void save(FileInfo fileInfo) throws ServiceException{
		fileInfoDao.save(fileInfo);

	}

	public boolean update(FileInfo fileInfo) throws ServiceException{
		return fileInfoDao.update(fileInfo);
	}

}
